package com.avfh.netcard.common;


import com.baomidou.mybatisplus.plugins.Page;

import java.util.List;

public class ResultPage {

    private List list;
    private CustomPage page;

    public ResultPage() {
    }

    public ResultPage(Page page) {
        this.page = new CustomPage()
                .setPage(page.getCurrent())
                .setTotal(page.getTotal())
                .setPage_count(page.getPages());
        this.list = page.getRecords();
    }

    public List getList() {
        return list;
    }

    public ResultPage setList(List list) {
        this.list = list;
        return this;
    }

    public CustomPage getPage() {
        return page;
    }

    public ResultPage setPage(CustomPage page) {
        this.page = page;
        return this;
    }

    class CustomPage {
        private int page_count;
        private int total;
        private int page;

        public int getPage_count() {
            return page_count;
        }

        public CustomPage setPage_count(int page_count) {
            this.page_count = page_count;
            return this;
        }

        public int getTotal() {
            return total;
        }

        public CustomPage setTotal(int total) {
            this.total = total;
            return this;
        }

        public int getPage() {
            return page;
        }

        public CustomPage setPage(int page) {
            this.page = page;
            return this;
        }
    }

}
